<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    .div{
      height:30px;
      width:1000px;
      display: flex;
    }
    .div>div{
      width:100%;
      height:30px;
      background:blue;
      display: flex;
      align-items: center;
      justify-content: center;
      color:#fff;
      cursor: pointer;
    }
    .div>div:hover{
      background: red;
    }
  </style>
</head>
<body>
  <div class="div">
    <div>新闻</div>
    <div>首页</div>
    <div>联系</div>
    <div>关于</div>
  </div>
</body>
</html>